/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Rodrigo
 */
@Entity
@Table(name = "parametro_generico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ParametroGenerico.findAll", query = "SELECT p FROM ParametroGenerico p"),
    @NamedQuery(name = "ParametroGenerico.findById", query = "SELECT p FROM ParametroGenerico p WHERE p.id = :id"),
    @NamedQuery(name = "ParametroGenerico.findByParametro", query = "SELECT p FROM ParametroGenerico p WHERE p.parametro = :parametro"),
    @NamedQuery(name = "ParametroGenerico.findByValor", query = "SELECT p FROM ParametroGenerico p WHERE p.valor = :valor"),
    @NamedQuery(name = "ParametroGenerico.findByDescripcion", query = "SELECT p FROM ParametroGenerico p WHERE p.descripcion = :descripcion")})
public class ParametroGenerico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "PARAMETRO")
    private String parametro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "VALOR")
    private String valor;
    @Size(max = 4000)
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "formaPago", fetch = FetchType.EAGER)
    private List<Transaccion> transaccionList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estadoTransaccion", fetch = FetchType.EAGER)
    private List<Transaccion> transaccionList1;

    public ParametroGenerico() {
    }

    public ParametroGenerico(Integer id) {
        this.id = id;
    }

    public ParametroGenerico(Integer id, String parametro, String valor) {
        this.id = id;
        this.parametro = parametro;
        this.valor = valor;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getParametro() {
        return parametro;
    }

    public void setParametro(String parametro) {
        this.parametro = parametro;
    }

    public String getValor() {
        return valor;
    }

    public void setValor(String valor) {
        this.valor = valor;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @XmlTransient
    public List<Transaccion> getTransaccionList() {
        return transaccionList;
    }

    public void setTransaccionList(List<Transaccion> transaccionList) {
        this.transaccionList = transaccionList;
    }

    @XmlTransient
    public List<Transaccion> getTransaccionList1() {
        return transaccionList1;
    }

    public void setTransaccionList1(List<Transaccion> transaccionList1) {
        this.transaccionList1 = transaccionList1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ParametroGenerico)) {
            return false;
        }
        ParametroGenerico other = (ParametroGenerico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.ParametroGenerico[ id=" + id + " ]";
    }
    
}
